<template>
  <div class="fileManagement">
    <SidebarLeft @chanegPage="chanegPage"></SidebarLeft>
    <div class="fileContent">
      <component :is="activeBar"></component>
    </div>

    <intelligentAssistant v-if="visibleAssistant" currentPage="file"></intelligentAssistant>
  </div>
</template>

<script>
import SidebarLeft from "@/views/fileManagement/components/SidebarLeft.vue"
import breadcrumb from "@/views/layout/breadcrumb.vue"
import myKnowledge from "./components/myKnowledge.vue"
import publicKonwledge from "./components/publicKonwledge.vue"
import questionsAnswers from "./components/questionsAnswers.vue"
import tool from "./components/tools/tool.vue"
import intelligentAssistant from "@/components/intelligentAssistant/chatWindow.vue"

export default {
  name: "fileManagement",
  components: {
    SidebarLeft,
    breadcrumb,
    myKnowledge,
    publicKonwledge,
    questionsAnswers,
    tool,
    intelligentAssistant,
  },
  data() {
    return {
      activeBar: "questionsAnswers",
      visibleAssistant: false,
    }
  },
  methods: {
    chanegPage(comp) {
      let hidendAsk = ["questionsAnswers", "tool"]
      this.visibleAssistant = !hidendAsk.includes(comp)
      // this.$emit("visibleWindow", !hidendAsk.includes(comp));
      this.activeBar = comp
    },
  },
}
</script>
<style lang="scss" scoped>
.fileManagement {
  width: 100%;
  height: 100%;
  background: #e6eaf0;
  display: flex;
  .fileContent {
    width: calc(100% - 298px);
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
  }
}
</style>
